package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
/**
 * @author YanMing
 */
@Repository
@Mapper
public interface  UserMapper extends BaseMapper<User> {
    @Select("select * from t_user where id= #{id}")
    User findById(Long id);

    @Select("select * from t_user where username= #{username}")
    User findByUsername(String username);

    @Select("select count(*) from t_user ")
    Long count();
}
